import {get,post} from "./http"

//登录
export const userLogin = (data) =>post("/api/userlogin",data)

// =================菜单管理==================
// 添加菜单
export const menuAdd = (params) => post("/api/menuadd",params)

//获取全部菜单
export const reqmenulist = params => get("/api/menulist", params)

//删除菜单
export const reqmenudelete = params => post("/api/menudelete", params)

//获取一条菜单
export const reqmenuinfo = params => get("/api/menuinfo", params)

//菜单修改
export const reqmenuedit = params => post("/api/menuedit", params)

// =================菜单管理==================

// =================角色管理==================
//角色添加
export const roleAdd = (params) => post("/api/roleadd",params)

// 角色列表
export const roleList = () => get("/api/rolelist")

// 角色删除
export const roleDel = (data) => post("/api/roledelete",data)

// 角色修改
export const roleEdit = (data) => post("/api/roleedit",data)

// 获取一个角色
export const roleInfo = (params) => get("/api/roleinfo",params)
// =================角色管理==================
// =================管理员管理==================
//管理员添加
export const userAdd = (params) => post("/api/useradd",params)

// 管理员总数
export const userCount = () => get("/api/usercount")

// 管理员列表
export const userList = (params) => get("/api/userlist",params)

// 管理员删除
export const userDel = (data) => post("/api/userdelete",data)

// 获取一个管理员
export const userInfo = (params) => get("/api/userinfo",params)

// 管理员修改
export const userEdit = (data) => post("/api/useredit",data)
// =================管理员管理==================

// =================商品分类管理==================
//商品分类添加
export const cateAdd = (params) => post("/api/cateadd",params,true)

// 商品分类列表
export const cateList = (params) => get("/api/catelist",params)
export const reqcatelist = (params) => get("/api/catelist",params)

// 获取一个商品分类
export const cateInfo = (params) => get("/api/cateinfo",params)

// 商品分类修改
export const cateEdit = (data) => post("/api/cateedit",data,true)

// 商品分类删除
export const cateDel = (data) => post("/api/catedelete",data)

// =================商品分类管理==================
// =================商品规格管理==================
// 管理员总数
export const specsCount = () => get("/api/specscount")

//商品规格添加
export const specsAdd = (params) => post("/api/specsadd",params)

// 商品规格列表
export const specsList = (params) => get("/api/specslist",params)

// 获取一个商品规格
export const specsInfo = (params) => get("/api/specsinfo",params)

// 商品规格修改
export const specsEdit = (data) => post("/api/specsedit",data)

// 商品规格删除
export const specsDel = (data) => post("/api/specsdelete",data)

// =================商品规格管理==================

//--商品模块start------------
// 添加
export const reqgoodsadd = params => post("/api/goodsadd", params,true);

//列表
export const reqgoodslist = params => get("/api/goodslist",params)

//删除
export const reqgoodsdelete = params => post("/api/goodsdelete", params)

//详情
export const reqgoodsinfo = params => get("/api/goodsinfo", params)

//修改
export const reqgoodsedit = params => post("/api/goodsedit", params,true)

//总数
export const reqgoodscount=()=>get("/api/goodscount")
//--商品模块end------------

// =================轮播图规格管理==================
//轮播图规格添加
export const bannerAdd = (params) => post("/api/banneradd",params,true)

// 轮播图规格列表
export const bannerList = () => get("/api/bannerlist")

// 获取一个轮播图规格
export const bannerInfo = (params) => get("/api/bannerinfo",params)

// 轮播图规格修改
export const bannerEdit = (data) => post("/api/banneredit",data,true)

// 轮播图规格删除
export const bannerDel = (data) => post("/api/bannerdelete",data)

// =================轮播图规格管理==================
// =================秒杀规格管理==================
//秒杀规格添加
export const seckAdd = (params) => post("/api/seckadd",params)

//二级分类下所有商品
export const twoGoods = (data) => get("/api/getgoodlist",data)

// 秒杀规格列表
export const seckList = () => get("/api/secklist")

// 获取一个秒杀规格
export const seckInfo = (params) => get("/api/seckinfo",params)

// 秒杀规格修改
export const seckEdit = (data) => post("/api/seckedit",data)

// 秒杀规格删除
export const seckDel = (data) => post("/api/seckdelete",data)

// =================秒杀规格管理==================